package jwdt.xadmin.work.bean;


import jwdt.xadmin.system.bean.TDep;
import jwdt.xadmin.system.bean.TUser;

import com.ezerg.db.Jdb;
import com.ezerg.db.annotation.Column;
import com.ezerg.db.annotation.Table;

@Table(name="t_doc", keys={"docid"}, comment="文档管理")
public class TDoc implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	
	@Column(value="docid", comment="ID")
	private Integer docid;

	@Column(value="classid", comment="ID")
	private Integer classid;
	
	@Column(value="name", comment="名称")
	private String name;
	
	@Column(value="content", comment="路径")
	private String content;
	
	@Column(value="dt", comment="创建时间")
	private String dt;
	
	@Column(value="zt", comment="状态")
	private Integer zt;
	
	@Column(value="userid", comment="上传人")
	private Integer userid;
	
	@Column(value="depid", comment="部门")
	private Integer deptid;

	public Integer getDocid() {
		return docid;
	}

	public void setDocid(Integer docid) {
		this.docid = docid;
	}

	public Integer getClassid() {
		return classid;
	}

	public void setClassid(Integer classid) {
		this.classid = classid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getDt() {
		return dt;
	}

	public void setDt(String dt) {
		this.dt = dt;
	}

	public Integer getZt() {
		return zt;
	}

	public void setZt(Integer zt) {
		this.zt = zt;
	}

	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public Integer getDeptid() {
		return deptid;
	}

	public void setDeptid(Integer deptid) {
		this.deptid = deptid;
	}

	public String getUserName(){
		TUser user = (TUser) Jdb.get().get(TUser.class, this.userid);
		return user.getUsername();
	}
	
	public String getDeptName(){
		TDep dept = (TDep) Jdb.get().get(TDep.class, this.deptid);
		return dept.getName();
	}
	
	public String getDocClassName(){
		TDocClass docClass = (TDocClass) Jdb.get().get(TDocClass.class, this.classid);
		return docClass.getName();
	}
}
